package com.ykdl.member.kid.beans;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import net.wxxr.http.interfaces.IJsonParser;

public class BreastFeeding extends Nursing {
	
	public static final int BREAST_FEED_LEFT = 1; //左乳
	public static final int BREAST_FEED_RIGHT = 2; //右乳
	public static final int BREAST_FEED_ALL = 3; //全部
	
	private int breast_type;//母乳类型
	private int duration;//时间
	private int vomits;//有无吐奶
	private float begin_time;//开始时间
	private float end_time;//喝完时间
	
	public BreastFeeding(){}
	
	public BreastFeeding(long id, long actor_id, int nursing_type,
			float create_time, int breast_type, int duration, int vomits,
			float begin_time, float end_time) {
		super(id, actor_id, nursing_type, create_time);
		this.breast_type = breast_type;
		this.duration = duration;
		this.vomits = vomits;
		this.begin_time = begin_time;
		this.end_time = end_time;
	}

	@Override
	public int getNursing_type() {
		return NURSING_RECORD_TYPE_BREAST_FEEDING;
	}
	
	public int getBreast_type() {
		return breast_type;
	}
	public void setBreast_type(int breast_type) {
		this.breast_type = breast_type;
	}
	public int getDuration() {
		return duration;
	}
	public void setDuration(int duration) {
		this.duration = duration;
	}
	public int getVomits() {
		return vomits;
	}
	public void setVomits(int vomits) {
		this.vomits = vomits;
	}
	public float getBegin_time() {
		return begin_time;
	}
	public void setBegin_time(float begin_time) {
		this.begin_time = begin_time;
	}
	public float getEnd_time() {
		return end_time;
	}
	public void setEnd_time(float end_time) {
		this.end_time = end_time;
	}
	
	@Override
	public IJsonParser parse(String json) throws Exception {
		Gson gson = null;
		if (gson == null) {
			GsonBuilder builder = new GsonBuilder();
			gson = builder.create();
			return gson.fromJson(json, Feeding.class);
		}
		return null;
	}
	
}
